package com.piece.blog.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 课程 training_course
 *
 * @author onepiece
 * @date 2023-08-29
 */
@Data
@NoArgsConstructor
@Entity
@Table(name = "training_course")
@ApiModel(value = "课程表")
public class TrainingCourse implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "course_id", length = 11)
    @ApiModelProperty(value = "课程ID")
    private Long courseId;

    @Column(name = "course_name")
    @ApiModelProperty(value = "课程名称")
    private String courseName;

    @Column(name = "thumbnail")
    @ApiModelProperty(value = "课程封面")
    private String thumbnail;

    @Column(name = "charge")
    @ApiModelProperty(value = "课程价格(元)")
    private BigDecimal charge;

    @Column(name = "short_desc")
    @ApiModelProperty(value = "课程简介")
    private String shortDesc;

    @Column(name = "class_hour")
    @ApiModelProperty(value = "课时数")
    private Long classHour;

    @Column(name = "status")
    @ApiModelProperty(value = "状态（0未发布 1已发布）")
    private String status;

    @Column(name = "create_by")
    @ApiModelProperty(value = "创建人ID")
    private Long createBy;

    @Column(name = "create_time")
    @ApiModelProperty(value = "创建时间")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @Column(name = "update_by")
    @ApiModelProperty(value = "修改人ID")
    private Long updateBy;

    @Column(name = "update_time")
    @ApiModelProperty(value = "修改时间")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

}
